// models/businessSchema.js
const mongoose = require('mongoose');

const businessSchema = new mongoose.Schema({
  username: { type: String, required: true }, // 业务员姓名
  machineId: { type: String, required: true }, // 机器的ID
  status: { type: String, enum: ['未处理', '已处理'], default: '未处理' }, // 处理状态，默认为未处理
  solution: { type: String, default: '' }, // 处理方案
  money: { type: String, default: '' }, //收款情况
  repairDestination: { type: String, default: '' }, // 维修去向
  createdAt: { type: Date, default: Date.now }, // 创建时间，默认为当前时间
  updatedAt: { type: Date, default: Date.now } //修改的时间，默认为当前时间
});

module.exports = mongoose.model('Business', businessSchema);